<template>
    <div id="bar" :style="{width:'100%',height:'50%'}" >
      <bar v-ref:refbar v-on:drillcondition-changed="listsearch"
           v-bind:condition="condition"
           :style="{width: '100%', height: '100%'}">
      </bar>
    </div>
    <div id="list" :style="{width:'100%',height:'50%'}" >
      <list v-ref:reflist v-on:condition-changed="barsearch"
            v-bind:total="total" v-bind:condition="condition"
            :style="{width: '100%', height: '100%'}">
      </list>
    </div>
</template>

  <script>
    import * as Util from '../Util'
    import bar from './bar.vue'
    import list from './List.vue'

    export default {
      title: "total",
      data () {
        return {
          texttile: '',
          condition: '1=1 ',
          total: '',
          startdate: {
            type: String,
            default: Util.toStandardDateString()
          },
          enddate: {
            type: String,
            default: Util.toStandardDateString()
          }
        }
      },
      components: {
        bar: bar,
        list: list
      },
      methods: {
        //明细列表调用饼状图的查询方法
        barsearch (param) {
          this.condition = param
          this.$refs.refbar.search(this.condition)
          console.log('明细列表调用饼状图的查询方法')
        },

        //饼状图调用明细列表的查询方法
        listsearch (param) {
          console.log(this.$refs.reflist, 'this.$refs.reflist')
          this.$refs.reflist.query(param)
          console.log('饼状图调用明细列表的查询方法' + param)
        },


        searchdata () {
        }
      },
      ready () {
        this.searchdata()
      },
      watch: {
      }
    }
</script>

<style scoped>

</style>
